package com.pic.service.impl;

import com.base.service.impl.ServiceImpl;
import com.pic.pojo.Pic;
import com.pic.service.IPicService;

public class PicServiceImpl<T extends Pic> extends ServiceImpl<T> implements IPicService<T> {

	@Override
	public boolean create(T pic) {
		if (dao.createQuery(
		" from Pic p where p.name = '"+pic.getName()+"'").list().size() > 0) {
			dao.save(pic);
			return false;
        }else{
		dao.create(pic);
		return true;
        }
		
	}

}
